<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>只响应一次</title>
</head>
<body>
<div id="app">
    <h1>{{ count }}</h1>
    <button @click="--count">-</button>
    <!--.once 修饰符 只响应一次-->
    <button @click.once="++count">+</button>
</div>

<script type="module">
    import {createApp, ref} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let count = ref(0)
                return {
                    count
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>